package com.jm.springboot21.mapper;

import com.jm.springboot21.pojo.Clazz;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClazzMapper {
    List<Clazz> findAll();
    //    根据部门名字查询部门
    Clazz findByName(String name);
    void add(Clazz clazz);
    void deleteById(int id);
    void updateById(Clazz clazz);
    //分页查询
    @Select("SELECT * FROM clazz LIMIT #{offset}, #{pageSize}")
    List<Clazz> selectByPage(@Param("offset") int offset, @Param("pageSize") int pageSize);

    @Select("SELECT COUNT(*) FROM clazz")
    long countTotal();
    @Select("select count(*) from clazz")
    Integer count();

}
